import Cookies from 'js-cookie'

const TokenKey = 'zhibaokeBaseKey'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token,time) {
  console.log(time)
  console.log("timesssssssssssssssssssssssssssssssssssssss")
  if(time){
    return Cookies.set(TokenKey, token,{ expires: 5 })
  }else{
    return Cookies.set(TokenKey, token)
  }
 
}

export function getTenancy() {
  return Cookies.get('Tenancy')
}


export function setTenancy(name) {
  return Cookies.set('Tenancy', name)
}
export function getTenancyName() {
  return Cookies.get('TenancyName')
}


export function setTenancyName(name) {
  return Cookies.set('TenancyName', name)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
